home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / realftp / testftp.frm < prev    next >
Text File  |  1997-05-06  |  5KB  |  169 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
  4. Object = "{0E4C9099-C4EB-11D0-B4B6-444553540000}#8.1#0"; "RealFtp.ocx"
  5. Begin VB.Form Form1 
  6.    Caption         =   "Form1"
  7.    ClientHeight    =   5820
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   7125
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5820
  13.    ScaleWidth      =   7125
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin RealFtp.Ftp Ftp1 
  16.       Left            =   120
  17.       Top             =   5160
  18.       _ExtentX        =   873
  19.       _ExtentY        =   873
  20.    End
  21.    Begin VB.CommandButton Command2 
  22.       Caption         =   "Stop"
  23.       Height          =   495
  24.       Left            =   6120
  25.       TabIndex        =   6
  26.       Top             =   480
  27.       Width           =   855
  28.    End
  29.    Begin VB.TextBox Text4 
  30.       Height          =   285
  31.       Left            =   4560
  32.       TabIndex        =   5
  33.       Text            =   "Text4"
  34.       Top             =   480
  35.       Width           =   495
  36.    End
  37.    Begin ComctlLib.ProgressBar ProgressBar1 
  38.       Height          =   255
  39.       Left            =   840
  40.       TabIndex        =   4
  41.       Top             =   840
  42.       Width           =   4215
  43.       _ExtentX        =   7435
  44.       _ExtentY        =   450
  45.       _Version        =   327680
  46.       Appearance      =   1
  47.       MouseIcon       =   "TestFtp.frx":0000
  48.    End
  49.    Begin VB.Timer Timer1 
  50.       Interval        =   1000
  51.       Left            =   720
  52.       Top             =   5160
  53.    End
  54.    Begin VB.TextBox Text3 
  55.       Height          =   285
  56.       Left            =   2760
  57.       TabIndex        =   3
  58.       Text            =   "Text3"
  59.       Top             =   480
  60.       Width           =   1215
  61.    End
  62.    Begin VB.TextBox Text2 
  63.       Height          =   285
  64.       Left            =   840
  65.       TabIndex        =   2
  66.       Text            =   "Text2"
  67.       Top             =   480
  68.       Width           =   1215
  69.    End
  70.    Begin VB.CommandButton Command1 
  71.       Caption         =   "Start"
  72.       Height          =   495
  73.       Left            =   5160
  74.       TabIndex        =   1
  75.       Top             =   480
  76.       Width           =   855
  77.    End
  78.    Begin RichTextLib.RichTextBox status 
  79.       Height          =   3855
  80.       Left            =   120
  81.       TabIndex        =   0
  82.       Top             =   1200
  83.       Width           =   6975
  84.       _ExtentX        =   12303
  85.       _ExtentY        =   6800
  86.       _Version        =   327680
  87.       ScrollBars      =   2
  88.       DisableNoScroll =   -1  'True
  89.       TextRTF         =   $"TestFtp.frx":001C
  90.    End
  91.    Begin VB.Label Label5 
  92.       Alignment       =   2  'Center
  93.       Caption         =   "This application is a sample only. You must edit the code before attempting use."
  94.       Height          =   255
  95.       Left            =   120
  96.       TabIndex        =   11
  97.       Top             =   120
  98.       Width           =   6855
  99.    End
  100.    Begin VB.Label Label4 
  101.       Caption         =   "Rate"
  102.       Height          =   255
  103.       Left            =   4080
  104.       TabIndex        =   10
  105.       Top             =   480
  106.       Width           =   495
  107.    End
  108.    Begin VB.Label Label3 
  109.       Caption         =   "Current"
  110.       Height          =   255
  111.       Left            =   2160
  112.       TabIndex        =   9
  113.       Top             =   480
  114.       Width           =   615
  115.    End
  116.    Begin VB.Label Label2 
  117.       Caption         =   "Total"
  118.       Height          =   255
  119.       Left            =   120
  120.       TabIndex        =   8
  121.       Top             =   480
  122.       Width           =   495
  123.    End
  124.    Begin VB.Label Label1 
  125.       Caption         =   "Progress"
  126.       Height          =   255
  127.       Left            =   120
  128.       TabIndex        =   7
  129.       Top             =   840
  130.       Width           =   735
  131.    End
  132. End
  133. Attribute VB_Name = "Form1"
  134. Attribute VB_GlobalNameSpace = False
  135. Attribute VB_Creatable = False
  136. Attribute VB_PredeclaredId = True
  137. Attribute VB_Exposed = False
  138. 'This application is a test application, please do not
  139. 'use it verbatim. You must edit the logon sequence and
  140. 'all transfer filenames.
  141. '
  142. Private Sub Command1_Click()
  143. Ftp1.Logon "ftp.myserver.com", "myusername", "mypassword"
  144. Ftp1.GetDir "c:\temp\dirlist.txt", "o"
  145. Ftp1.SendFile "c:\temp\zbspro.exe", "zbspro.exe", 1
  146. Ftp1.GetFile "c:\temp\zbspro2.exe", "zbspro.exe", 1
  147. Ftp1.CloseFtp
  148. End Sub
  149.  
  150. Private Sub Command2_Click()
  151. Ftp1.FtpStop
  152. End Sub
  153.  
  154. Private Sub ftp1_SocketError(ByVal s As String)
  155. status.Text = status.Text + s + Chr(13) + Chr(10)
  156. End Sub
  157. Private Sub ftp1_SocketCompleted()
  158. status.Text = status.Text + "Complete" + Chr(13) + Chr(10)
  159. End Sub
  160. Private Sub ftp1_SocketResponse(ByVal s As String)
  161. status.Text = status.Text + "res:" + s + vbCrLf
  162. End Sub
  163. Private Sub Timer1_Timer()
  164. Text2.Text = Str(Ftp1.CurrentBytes)
  165. Text3.Text = Str(Ftp1.TotalBytes)
  166. Text4.Text = Str(Ftp1.TransferRate)
  167. ProgressBar1.Value = Ftp1.CompletedPercent
  168. End Sub
  169.